1. Field of the Invention
The present invention relates to networking technology. More particularly, the present invention relates to providing ICMP redirects in a router implementing a virtual router protocol.
2. Description of the Related Art
Networks are commonly used by organizations for a variety of purposes. For instance, through the use of networks, resources such as programs and data may be shared by users of the network. In addition, a computer network can serve as a powerful communication medium among widely separated users.
Communication among hosts and users of a network is often facilitated through connection to one or more routers. As shown in FIG. 1, a host 112 normally resides on a network segment 114 that enables its network entities to communicate with other entities or networks. Note that the host 112 need not directly connect to the entities or networks with which it communicates. For example, as shown in FIG. 1, the host 112 may be connected through one of several routers R1 116, R2 118, or R3 120.
Now, suppose that the host 112 wishes to send a message to a corresponding node 122. A message from the host 112 is then packetized and forwarded through router R1 116 and to the corresponding node 122 according to a standard protocol. If the corresponding node 122 wishes to send a message to the host 112—whether in reply to a message from the host 112 or for any other reason—it addresses that message to the IP address of the host 112 on the network segment 114. The packets of that message are then forwarded to router R1 116 and ultimately to the host 112.
As described above, packets sent to and from the corresponding node 122 are forwarded via the router R1 116. As shown, the router R1 116 is the only route to and from the corresponding node 122. Thus, if the router R1 116 fails, communication with the corresponding node 122 becomes impossible. Accordingly, the reliability of the network as well as the routers in the network is of utmost importance.
As networks become a critical resource in many organizations, it is important that the networks are reliable. One way of achieving reliability is through redundancy. As described above, a single router failure may prevent communication to and from each host and user connected to the router. In many networks, it is common to provide redundancy through the use of multiple routers such that a backup router functions in the event of failure of a primary router. This is accomplished through the use of a virtual router protocol such as the Virtual Router Redundancy Protocol (VRRP) or the Hot Standby Redundancy Protocol (HSRP). HSRP is further described in U.S. Pat. No. 5,473,599.
According to HSRP, a protocol available from Cisco Systems, Inc. located in San Jose, Calif., multiple routers share a common MAC address and a virtual IP address. In addition, each of the routers has its own unique MAC address that will be used by the router for advertising routes to other routers. A router may be in one of three states according to HSRP: an active state, a standby state, and a listen state. When a router is in the active state, the router is responsible for actively forwarding packets addressed to the virtual IP address. Similarly, when a router is in the standby state, the router becomes active when the active router becomes non-functional. Thus, when the active router fails, the standby router takes over both the shared virtual IP address and the shared MAC address. A router that is in the listen state merely listens to packets that are sent to it and collects this information in the event that it later becomes an active or standby router.
As shown in FIG. 2, a system diagram illustrates the state of each router in accordance with the HSRP protocol. In this example, a network segment “Net C” 124 is connected to the second router R2 118 and the third router R3 120. When the host 112 wishes to send a packet to the subnet “Net C” 124, it may send the packet via the second router R2 118 or the third router R3 120. The Internet Control Message Protocol (ICMP), described in RFC 792 of the Network Working Group, J. Postel, September 1981, may be used to notify the host that the optimal path to the subnet 124 is via the second router R2 118. More particularly, when a gateway such as router R1 116 receives a packet, it checks its routing table to obtain the address of the next hop, or next gateway, router R2 118. If the second router R2 118 and the host 112 are on the same network, a redirect message is sent to the host 112. The redirect message advises the host 112 to send its traffic for Network C directly to the second router R2 118 since this is a shorter path to the destination. This is accomplished by specifying the IP address of the second router R2 118 in the redirect message.
While the use of an ICMP redirect message may be used to notify a router of the optimal path to a particular destination, the ICMP redirect feature is typically disabled when a virtual router protocol such as HSRP is enabled. For example, as described above with reference to FIG. 2, a redirect message may be sent to the host 112 indicating that the optimal path to the subnet C is via the second router R2 118. Once the host 112 has discovered the IP address of the second router R2 118, it will automatically address each packet sent to the subnet C to the second router R2 118. It follows that when the second router R2 118 fails, packets sent to the second router R2 118 will never be received by the intended destination. Although the HSRP protocol is designed to send the packet via the alternate route to the subnet C 124 through the third router R3 120 upon failure of the second router R2 118, the ICMP redirect feature prevents the redundancy feature from functioning properly. Thus, although the redundancy feature is designed to ensure that the packet is received by its intended destination, the packet will not necessarily be received by its intended destination when the ICMP redirect feature is enabled. For this reason, the ICMP redirect feature is typically disabled when the HSRP protocol is enabled.
While disabling the ICMP redirect feature may be desirable in certain instances, disabling the ICMP redirect feature is problematic on networks where different routers (and/or HSRP groups) provide different routes to remote networks. More particularly, packets sent to devices on remote networks for which the HSRP active router does not provide the optimal route will traverse the local network twice since the active router must forward them to the optimal path router.
In view of the above, it would be desirable to enable a redirect feature such as the ICMP redirect feature to be used with a virtual router protocol such as HSRP. In this manner, a packet may be sent via an optimal path while retaining the redundancy features of a virtual router protocol.